package com.song.controller;

import com.song.model.Dog;
import com.song.service.DogService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.io.PipedReader;
import java.io.PrintStream;

/**
 * @ClassName : DogController
 * @Author : 司猫子
 * @Date: 2021/3/3 9:26
 */
@RestController
public class DogController {
    @DubboReference(interfaceClass = DogService.class,version = "1.0")
    private DogService dogService;

    @GetMapping("/dog/{name}")
    public String queryDog(@PathVariable String name){
        Dog dog = dogService.queryDog(name);
        return dog.toString();
    }
}
